import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class TagProcess {
	BufferedReader reader = null;
	BufferedWriter writer = null;
	public TagProcess()throws Exception{
		String url = new String("C://test.txt");
		reader = new BufferedReader(new InputStreamReader(new FileInputStream(url)));
		writer = new BufferedWriter(new FileWriter("C://test1.txt"));
		String line = new String();
		while((line=reader.readLine())!=null){
			line.trim();
//			Pattern expression = Pattern.compile("<[a-zA-Z]+><[a-zA-Z=\" ]+>[a-zA-Z,.;`'()-@&! ]+</[a-zA-Z]+></[a-zA-Z]+>");
			Pattern expression = Pattern.compile("[a-zA-Z,.;`'()-@&! ]+");
			Matcher matcher = expression.matcher(line);
			Object word = null;
			if(matcher.find()){
				word = matcher.group();
//				String[] temp = ((String)word).split(">");
//				System.out.println(temp[1]+">");
//				System.out.println(temp[2]+">");
//				writer.write(temp[1]+">");
//				writer.write(temp[2]+">"+'\n');
				System.out.println(word);
			}else{
//				writer.write(line+'\n');
			}
		}
		writer.flush();
		
	}
	
	public static void main(String[] args){
		try{
			TagProcess tp = new TagProcess();
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
